package o;

import androidx.annotation.Nullable;
import com.google.android.exoplayer2.metadata.Metadata;
import java.io.EOFException;
import java.io.IOException;
import o.ahm.d;

public final class aeb {
    private final anc ˎ = new anc(10);

    @Nullable
    public Metadata ˏ(adv o_adv, @Nullable d dVar) throws IOException, InterruptedException {
        Metadata metadata = null;
        int i = 0;
        while (true) {
            try {
                o_adv.ˎ(this.ˎ.ˏ, 0, 10);
                this.ˎ.ˋ(0);
                if (this.ˎ.ˏॱ() != ahm.ˊ) {
                    break;
                }
                this.ˎ.ˎ(3);
                int ʿ = this.ˎ.ʿ();
                int i2 = ʿ + 10;
                if (metadata == null) {
                    byte[] bArr = new byte[i2];
                    System.arraycopy(this.ˎ.ˏ, 0, bArr, 0, 10);
                    o_adv.ˎ(bArr, 10, ʿ);
                    metadata = new ahm(dVar).ˏ(bArr, i2);
                } else {
                    o_adv.ˊ(ʿ);
                }
                i += i2;
            } catch (EOFException e) {
            }
        }
        o_adv.ˏ();
        o_adv.ˊ(i);
        return metadata;
    }
}
